# frozen_string_literal: true

module GqlTypes
  class DateTimeType < GraphQL::Schema::Scalar
    def self.coerce_input(value, _ctx)
      DateTime.iso8601(value)
    end

    def self.coerce_result(value, _ctx)
      value.to_datetime.utc.iso8601
    end
  end
end
